home *** CD-ROM | disk | FTP | other *** search
/ All for Cell Phones: Sony Ericsson / Sony-Ericsson 2004.iso / Java / MChess / MobileChess.jar / G / C.class (.txt) < prev    next >
Encoding:
Java Class File  |  2002-07-18  |  1.8 KB  |  117 lines

  1. package G;
  2.  
  3. import H.Z;
  4. import J.I;
  5. import java.io.InputStream;
  6. import org.jrra.network.Communicator;
  7.  
  8. // $FF: renamed from: G.C
  9. public class class_0 {
  10.    private I available;
  11.    private B notify;
  12.    private Object notifyAll = new Object();
  13.    private Object read = new Object();
  14.    private int start;
  15.    private boolean wait;
  16.  
  17.    private class_0(I var1, A.I var2) {
  18.       this.available = var1;
  19.       this.notify = B.I(var1, var2, this);
  20.       this.wait = false;
  21.    }
  22.  
  23.    // $FF: renamed from: I (H.Z) void
  24.    public final void method_0(Z var1) {
  25.       this.available(var1, 10, -1);
  26.    }
  27.  
  28.    public final void available(Z var1, int var2, int var3) {
  29.       (new Thread(new G.Z(this, var1, var2, var3, (Communicator.1)null))).start();
  30.  
  31.       while(!this.wait) {
  32.          Object var4 = this.notifyAll;
  33.          synchronized(var4) {
  34.             try {
  35.                this.notifyAll.wait();
  36.             } catch (InterruptedException var7) {
  37.             }
  38.          }
  39.       }
  40.  
  41.       var1.B();
  42.    }
  43.  
  44.    // $FF: renamed from: I (java.io.InputStream, H.Z, int) void
  45.    public final void method_1(InputStream var1, Z var2, int var3) {
  46.       int var5 = 0;
  47.  
  48.       int var4;
  49.       while((var4 = var1.available()) != 0) {
  50.          ++var5;
  51.          byte[] var6 = new byte[var4 > var3 ? var3 : var4];
  52.          var1.read(var6);
  53.          var2.I(var6);
  54.       }
  55.  
  56.    }
  57.  
  58.    // $FF: renamed from: I (J.I, A.I) G.C
  59.    public static final class_0 method_2(I var0, A.I var1) {
  60.       return new class_0(var0, var1);
  61.    }
  62.  
  63.    // $FF: renamed from: I () void
  64.    public final void method_3() {
  65.       this.wait = true;
  66.       this.notify.I();
  67.       Object var1 = this.notifyAll;
  68.       synchronized(var1) {
  69.          this.notifyAll.notifyAll();
  70.       }
  71.  
  72.       try {
  73.          Object var2 = this.read;
  74.          synchronized(var2) {
  75.             this.read.wait(50L);
  76.          }
  77.       } catch (InterruptedException var5) {
  78.       }
  79.  
  80.    }
  81.  
  82.    private synchronized void read() {
  83.       ++this.start;
  84.    }
  85.  
  86.    private synchronized void start() {
  87.       --this.start;
  88.       if (this.start == 0) {
  89.          Object var1 = this.read;
  90.          synchronized(var1) {
  91.             this.read.notify();
  92.          }
  93.       }
  94.  
  95.    }
  96.  
  97.    // $FF: renamed from: I (G.C) void
  98.    static final void method_4(class_0 var0) {
  99.       var0.read();
  100.    }
  101.  
  102.    // $FF: renamed from: Z (G.C) boolean
  103.    static final boolean method_5(class_0 var0) {
  104.       return var0.wait;
  105.    }
  106.  
  107.    // $FF: renamed from: C (G.C) G.B
  108.    static final B method_6(class_0 var0) {
  109.       return var0.notify;
  110.    }
  111.  
  112.    // $FF: renamed from: B (G.C) void
  113.    static final void method_7(class_0 var0) {
  114.       var0.start();
  115.    }
  116. }
  117.